import { IHttpRes } from '@core/net/HttpResponse';
import { Injectable } from '@angular/core';
import { ApiService } from '@core/net/api.service';

@Injectable({
	providedIn: 'root'
})
export class HomeService {

	constructor(
		private apiService: ApiService
	) { }

	/**
	 * 当月爆料记录
	 * @returns 
	 */
	discloseEchart(): Promise<IHttpRes<any>> {
		return this.apiService.post('/info/tdatadisclose/echart').toPromise();
	}



	/**
	 * 计算社区
	 * @returns 
	 */
	addrStatisticsCommunity(): Promise<IHttpRes<any>> {
		return this.apiService.get('/info/tdataareaaddr/statisticsCommunity').toPromise();
	}



	/**
	 * 计算网格员
	 * @returns 
	 */
	griderStatistic(): Promise<IHttpRes<any>> {
		return this.apiService.get('/info/tdatagrider/statistic').toPromise();
	}


	/**
	 * 走访图表
	 * @returns
	 */
	visitEchart(type): Promise<IHttpRes<any>> {
		return this.apiService.post(`/info/tdatagridervisit/echart/${type}`).toPromise();
	}
}
